﻿using MediatR;
using S.EarTag.API.Application.MediatorCommand.MarkCommand;
using S.EarTag.Infrastructure.Repository.Interface.IEarTagRepository;

namespace S.EarTag.API.Application.MediatorCommandHandler.MarkCommandHandler
{
    public class MarkStateEarTagTwoCommandHandler : IRequestHandler<MarkStateEarTagTwoCommand, bool>
    {
        private readonly IMarkModelRepository _markModelRepository;
        public MarkStateEarTagTwoCommandHandler(IMarkModelRepository markModelRepository)
        {
            _markModelRepository= markModelRepository;
        }
        /// <summary>
        /// 根据可视耳号修改状态为未使用
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public async Task<bool> Handle(MarkStateEarTagTwoCommand request, CancellationToken cancellationToken)
        {
            return await _markModelRepository.UpdMarkStateEarTagTwo(request.EarTag);
        }
    }
}
